Skip to content

Conversation

@kazantsev-maksim
Copy link
Contributor

@kazantsev-maksim kazantsev-maksim commented Nov 8, 2025

Which issue does this PR close?

Closes #2513

Rationale for this change

#2513

What changes are included in this PR?

LocalTableScanExec operator implementation has been added:

  1. CometLocalTableScan.scala - serialization has been added
  2. QueryPlanSerde.scala - registered LocalTableScanExec for serialization in the opSerdeMap
  3. CometLocalTableScanExec.scala - implementation of the operator
  4. CometConf.scala - added enableCometLocalTableScan flag

How are these changes tested?

Added new unit test

@kazantsev-maksim kazantsev-maksim marked this pull request as draft November 8, 2025 08:54
@mbutrovich
Copy link
Contributor

Very cool! Kicking off CI.

@kazantsev-maksim kazantsev-maksim marked this pull request as ready for review November 8, 2025 16:41
Comment on lines 537 to 543
case op: LocalTableScanExec if CometConf.COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED.get(conf) =>
val nativeOp = QueryPlanSerde.operator2Proto(op)
val cometOp = CometLocalTableScanExec(op, op.rows, op.output)
CometScanWrapper(nativeOp.get, cometOp)

case op: LocalTableScanExec if !CometConf.COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED.get(conf) =>
withInfo(op, "LocalTableScan is not enabled")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could be combined into a single match arm.

Suggested change
case op: LocalTableScanExec if CometConf.COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED.get(conf) =>
val nativeOp = QueryPlanSerde.operator2Proto(op)
val cometOp = CometLocalTableScanExec(op, op.rows, op.output)
CometScanWrapper(nativeOp.get, cometOp)
case op: LocalTableScanExec if !CometConf.COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED.get(conf) =>
withInfo(op, "LocalTableScan is not enabled")
case op: LocalTableScanExec =>
if (CometConf.COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED.get(conf)) {
val nativeOp = QueryPlanSerde.operator2Proto(op)
val cometOp = CometLocalTableScanExec(op, op.rows, op.output)
CometScanWrapper(nativeOp.get, cometOp)
} else {
withInfo(op, "LocalTableScan is not enabled")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.

@andygrove
Copy link
Member

This is looking great. I suspect there may be some failures in the Spark SQL test suite (see #2714 where I enabled converting LocalTableScan to columnar), so we may want to disable this by default until we have addressed the reasons for those failures.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2025

Codecov Report

❌ Patch coverage is 82.43243% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.58%. Comparing base (f09f8af) to head (d7dffe2).
⚠️ Report is 678 commits behind head on main.

Files with missing lines Patch % Lines
...ache/spark/sql/comet/CometLocalTableScanExec.scala 73.46% 3 Missing and 10 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2735      +/-   ##
============================================
+ Coverage     56.12%   58.58%   +2.45%     
- Complexity      976     1475     +499     
============================================
  Files           119      161      +42     
  Lines         11743    13964    +2221     
  Branches       2251     2383     +132     
============================================
+ Hits           6591     8181    +1590     
- Misses         4012     4573     +561     
- Partials       1140     1210      +70     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kazantsev-maksim
Copy link
Contributor Author

This is looking great. I suspect there may be some failures in the Spark SQL test suite (see #2714 where I enabled converting LocalTableScan to columnar), so we may want to disable this by default until we have addressed the reasons for those failures.

Thanks @andygrove! I have set COMET_EXEC_LOCAL_TABLE_SCAN_ENABLED to false as the default

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kazantsev-maksim
Copy link
Contributor Author

Thanks @mbutrovich @andygrove for the review

Copy link
Contributor

@mbutrovich mbutrovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great addition, thank you @kazantsev-maksim!

@andygrove andygrove merged commit 9b91c25 into apache:main Nov 9, 2025
182 of 184 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support LocalTableScanExec

4 participants